#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Author: yinwh
@Time: 2025-06-08 10:59
@File: demo.py
@Version: 1.0.0
@Description: 
@Copyright: (c) 2025 by yinwh. All rights reserved.
"""


from client import LLMAgent
from tools import add, count_letter_in_string, mul, get_current_datetime

from openai import OpenAI

if __name__ == '__main__':
    client = OpenAI(
        api_key = "sk-xxxxx",
        base_url = "https://api.deepseek.com"
    )

    agent = LLMAgent(
        client=client,
        model="deepseek-chat",
        tools=[get_current_datetime, add, mul, count_letter_in_string]
    )

    while True:
        prompt = input("\033[94mUser: \033[0m")

        if prompt == "exit":
            break

        response = agent.get_completion(prompt)
        print("\033[92mAssistant: \033[0m", response)
